/*
 * @Author: hmhvictory 1400628624@qq.com
 * @Date: 2025-08-01 16:03:57
 * @LastEditors: hmhvictory 1400628624@qq.com
 * @LastEditTime: 2025-08-01 16:04:09
 * @FilePath: \Gitee实训笔记\day15\Homework\test01\test02\Worker.java
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
package day15.test02;

// 工人类
class Worker extends Employee {
    private int workDays;

    public Worker(String name, String gender, String birthDate, int workDays) {
        super(name, gender, birthDate);
        this.workDays = workDays;
    }

    @Override
    public void computeSalary() {
        // 假设每天工资为 200 元
        double salary = workDays * 200;
        System.out.println("工人 " + getName() + " 本月工资为 " + salary + " 元。");
    }
}

